package com.infore.qualityControl.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.infore.qualityControl.bo.QualityParamSelectBo;
import com.infore.qualityControl.remoteService.IDataReceivingService;
import com.infore.qualityControl.select.util.PageObject;
import com.infore.qualityControl.service.ITestDataService;
import com.infore.qualityControl.util.ResultEntity;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
 * 测试数据控制器
 * @author Cold
 *
 */
@Api(value = "测试数据管理接口", tags = {"测试数据管理接口"})
@RestController
@RequestMapping("/testData")
public class TestDataController {
	
	@Autowired
	ITestDataService iTestDataService;
	
	@Autowired
	IDataReceivingService IDataReceivingService;
	
	@ApiOperation(value = "获取24小时零点漂移表格数据")
	@ResponseBody
	@RequestMapping(value = "/zeroDriftData", method = RequestMethod.GET)
	public ResultEntity zeroDriftData(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
		return iTestDataService.zeroDriftData(qualityParamSelectBo, pageObject);
	}
	
	@ApiOperation(value = "获取24小时零点漂移图表数据")
	@ResponseBody
	@RequestMapping(value = "/zeroDriftChartData", method = RequestMethod.GET)
	public ResultEntity zeroDriftChartData(QualityParamSelectBo qualityParamSelectBo) {
		return iTestDataService.zeroDriftChartData(qualityParamSelectBo);
	}
	
	@ApiOperation(value = "获取24小时跨度漂移表格数据")
	@ResponseBody
	@RequestMapping(value = "/spanDriftData", method = RequestMethod.GET)
	public ResultEntity spanDriftData(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
		return iTestDataService.spanDriftData(qualityParamSelectBo, pageObject);
	}
	
	@ApiOperation(value = "获取24小时跨度漂移图表数据")
	@ResponseBody
	@RequestMapping(value = "/spanDriftChartData", method = RequestMethod.GET)
	public ResultEntity spanDriftChartData(QualityParamSelectBo qualityParamSelectBo) {
		return iTestDataService.spanDriftChartData(qualityParamSelectBo);
	}
	
	@ApiOperation(value = "获取常规五参数核查表格数据")
	@ResponseBody
	@RequestMapping(value = "/fiveParameterData", method = RequestMethod.GET)
	public ResultEntity fiveParameterData(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
		return iTestDataService.fiveParameterData(qualityParamSelectBo, pageObject);
	}
	
	@ApiOperation(value = "获取常规五参数核查图表数据")
	@ResponseBody
	@RequestMapping(value = "/fiveParameterChartData", method = RequestMethod.GET)
	public ResultEntity fiveParameterChartData(QualityParamSelectBo qualityParamSelectBo) {
		return iTestDataService.fiveParameterChartData(qualityParamSelectBo);
	}
	
	@ApiOperation(value = "获取自动与手工比对测试数据")
	@ResponseBody
	@RequestMapping(value = "/automaticAndManualComparisonData", method = RequestMethod.GET)
	public ResultEntity automaticAndManualComparisonData(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
		return iTestDataService.automaticAndManualComparisonData(qualityParamSelectBo, pageObject);
	}
	
	@ApiOperation(value = "获取多点线性核查表格数据")
	@ResponseBody
	@RequestMapping(value = "/multipointlinearityData", method = RequestMethod.GET)
	public ResultEntity multipointlinearityData(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
		return iTestDataService.multipointlinearityData(qualityParamSelectBo, pageObject);
	}
	
	@ApiOperation(value = "获取实际水样对比表格数据")
	@ResponseBody
	@RequestMapping(value = "/realWaterSampleComparisonData", method = RequestMethod.GET)
	public ResultEntity realWaterSampleComparisonData(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
		return iTestDataService.realWaterSampleComparisonData(qualityParamSelectBo, pageObject);
	}
	
	@ApiOperation(value = "获取集成干预检查表格数据")
	@ResponseBody
	@RequestMapping(value = "/integratedInterventionData", method = RequestMethod.GET)
	public ResultEntity integratedInterventionData(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
		return iTestDataService.integratedInterventionData(qualityParamSelectBo, pageObject);
	}
	
	@ApiOperation(value = "获取集成干预检查图表数据")
	@ResponseBody
	@RequestMapping(value = "/integratedInterventionChartData", method = RequestMethod.GET)
	public ResultEntity integratedInterventionChartData(QualityParamSelectBo qualityParamSelectBo) {
		return iTestDataService.integratedInterventionChartData(qualityParamSelectBo);
	}
	
	@ApiOperation(value = "获取加标回收率表格数据")
	@ResponseBody
	@RequestMapping(value = "/recoveryData", method = RequestMethod.GET)
	public ResultEntity recoveryData(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
		return iTestDataService.recoveryData(qualityParamSelectBo, pageObject);
	}
	
	@ApiOperation(value = "获取加标回收率相关占比数据")
	@ResponseBody
	@RequestMapping(value = "/recoveryRatioData", method = RequestMethod.GET)
	public ResultEntity recoveryRatioData(QualityParamSelectBo qualityParamSelectBo) {
		return iTestDataService.recoveryRatioData(qualityParamSelectBo);
	}
	
	@ApiOperation(value = "获取加标回收率曲线图表数据")
	@ResponseBody
	@RequestMapping(value = "/recoveryChartData", method = RequestMethod.GET)
	public ResultEntity recoveryChartData(QualityParamSelectBo qualityParamSelectBo) {
		return iTestDataService.recoveryChartData(qualityParamSelectBo);
	}
	
	@ApiOperation(value = "获取加标回收率柱状图表数据")
	@ResponseBody
	@RequestMapping(value = "/recoveryBarChartData", method = RequestMethod.GET)
	public ResultEntity recoveryBarChartData(QualityParamSelectBo qualityParamSelectBo) {
		return iTestDataService.recoveryBarChartData(qualityParamSelectBo);
	}
	
	@ApiOperation(value = "获取标样核查表格数据")
	@ResponseBody
	@RequestMapping(value = "/verificationOfStandardSamplesData", method = RequestMethod.GET)
	public ResultEntity verificationOfStandardSamplesData(QualityParamSelectBo qualityParamSelectBo,
			PageObject pageObject) {
		return iTestDataService.verificationOfStandardSamplesData(qualityParamSelectBo, pageObject);
	}
	
	@ApiOperation(value = "获取标样核查相关占比数据")
	@ResponseBody
	@RequestMapping(value = "/verificationOfStandardSamplesRatioData", method = RequestMethod.GET)
	public ResultEntity verificationOfStandardSamplesRatioData(QualityParamSelectBo qualityParamSelectBo) {
		return iTestDataService.verificationOfStandardSamplesRatioData(qualityParamSelectBo);
	}
	
	@ApiOperation(value = "获取标样核查曲线图表数据")
	@ResponseBody
	@RequestMapping(value = "/verificationOfStandardSamplesChartData", method = RequestMethod.GET)
	public ResultEntity verificationOfStandardSamplesChartData(QualityParamSelectBo qualityParamSelectBo) {
		return iTestDataService.verificationOfStandardSamplesChartData(qualityParamSelectBo);
	}
	
	@ApiOperation(value = "获取标样核查柱状图表数据")
	@ResponseBody
	@RequestMapping(value = "/verificationOfStandardSamplesBarChartData", method = RequestMethod.GET)
	public ResultEntity verificationOfStandardSamplesBarChartData(QualityParamSelectBo qualityParamSelectBo) {
		return iTestDataService.verificationOfStandardSamplesBarChartData(qualityParamSelectBo);
	}
	
	@ApiOperation(value = "获取日志与状态量参数数据")
	@ResponseBody
	@RequestMapping(value = "/logStatusData", method = RequestMethod.GET)
	public ResultEntity logStatusData(String mn, String beginTime, String endTime, String logType, PageObject pageObject) {
		return IDataReceivingService.queryLogStatusData(mn, beginTime, endTime, logType, pageObject.getPageNumber(), pageObject.getPageSize());
	}
}
